package net.huashitong.scheduling.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;

import net.huashitong.scheduling.entity.IndustryRevenue;

@Repository
public class IndustryRevenueDao extends StringDao<IndustryRevenue>{
  /**
   * 根据项目查询数据
   * @param name
   * @return
   */
  public IndustryRevenue queryByName(String name){
	  GenericQuery query = createQuery("obj");
	  query.append(" and obj.name= :name").setParam("name", name);
	  return query.firstResult();
  }
  
  public List<IndustryRevenue> queryBySysId(String sysId){
	  GenericQuery query = createQuery("obj");
	  query.append(" and obj.parentId= :parentId order by cast(obj.yearIncome as int) desc ").setParam("parentId",sysId);
	  
	  return query.listResult();
  }
  
}
